{% extends "main.html" %}

{% block title %}{{ post['title'] }}{% end %}

{% block body %}
<div><a href="/blog/newpost">{{ _("Write") }}</a></div>
	<div>
		<div><strong>
			{{ post['author'] }} : 
			{{ post['title'] }}
			( {{ locale.format_date(post['time'], full_format=True, shorter=False) }} )
		</strong></div>
		<div>{{ post['postcontentbb'] }}</div>
		<div><small>
            {% for tag in post['tags'] %}
                <a href="/blog/search/tags?tag={{ tag }}">{{ tag }}</a>
            {% end %}
        </small></div>
		<div>
			<a href="/blog/edit/{{ post['_id'] }}">{{ _("Edit") }}</a>
			<a href="/blog/edit/{{ post['_id'] }}?mode=delpost">{{ _("Delete") }}</a>
		</div>
        <div>
            {% for comment in post['comments'] %}
                <div><strong>
                    {{ comment['author'] }} :
                    ( {{ locale.format_date(comment['time'], full_format=False, shorter=True) }} )
                </strong></div>
                <p>{{ comment['text'] }}</p>
            {% end %}
        </div>
        <div>
            <form action="/blog/newpostcomment/{{ post['_id'] }}" method="post">
                <textarea rows="10" cols="35" name="postcomment"></textarea><br>
                <input class="button" type="submit" name="newpostcomment" value="{{ _("Write") }}">
                {{ xsrf_form_html() }}
            </form>
        </div>
	</div>
{% end %}